﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WFpro1
{
    public partial class Form1 : Form
    {
        int num = 0;
        public Form1()
        {
            InitializeComponent();
        }
        public bool Ispick(int a)
        {
            for (int k = 2; k < a; k++)
            {
                if (a % k == 0)
                {
                    return false;
                }
                
            }
            return true;
        }
        private void button1_Click(object sender, EventArgs e)
        {
            int up = int.Parse(max.Text);
            int down = int.Parse(min.Text);
            for(int j = down; j <= up; j++)
            {
                if (Ispick(j))
                {
                    result.Text += j.ToString() + " ";
                    num++;
                    if (num!=0&&num % 10==0)
                {
                    result.Text += "\r\n";
                }
                }
                
            }
        }

        private void max_TextChanged(object sender, EventArgs e)
        {

        }

        private void result_TextChanged(object sender, EventArgs e)
        {

        }
    }
}
